package myStudent

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'POST'
        url value(consumer(regex('/api/programs/\\d+/tutors/\\d+/students/\\S+')),
                producer('/api/programs/1/tutors/1/students/1,2'))
    }
    response {
        status 201
        body("""
            [
                "1",
                "2"
            ]
        """)
        headers {
            contentType(applicationJsonUtf8())
        }
        bodyMatchers {
            jsonPath('$.[*]', byType())
            jsonPath('$.[*]', byRegex(nonEmpty()))
        }
    }

}